// @ts-nocheck

import health from '@blueos.health.health'

export const getRecentSamples = () => {
  return new Promise((resolve, reject) => {
    health.getRecentSamples({
      dataTypes: [
        health.DATA_TYPES.HEART_RATE,
        health.DATA_TYPES.SPO2,
        health.DATA_TYPES.CALORIES,
        health.DATA_TYPES.STRESS
      ],
      success: (res) => {
        if (process.env.NODE_ENV == 'development') {
          resolve([
            { "dataType": 0, "data": { "timeStamp": 0, "value": 80 } },
            { "dataType": 6, "data": { "timeStamp": 1709095977, "value": 97 } },
            { "dataType": 8, "data": { "timeStamp": 0, "value": 80 } },
            { "dataType": 9, "data": { "timeStamp": 1710561758, "value": 44 } }
          ])
        } else {
          resolve(res)
        }
      },
      fail: () => {
        console.log('fail')
        reject()
      }
    })
  })

}